package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.HeadParamBean;
import com.sx.gongzhong.model.IntegralBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.IntegralView;

import java.util.Map;

/**我的积分
 * Created by admin on 2018/1/31.
 */

public class IntegralPest {
    private IntegralView integralView;

    public IntegralPest(IntegralView integralView) {
        this.integralView = integralView;
    }

    public void getMyIntegral() {
        Map<String,Object> map = HeadParamBean.getHead();
        new ApiManager().getMyIntegral(map, new BaseCallBack<ReplyUserBean.BaseResult<IntegralBean>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<IntegralBean> response) {
                integralView.success(response.data);
            }
            @Override
            public void onFailures(String message) {
                integralView.showError(message);
            }
        });
    }
}
